package com.chixing.service;

import com.chixing.entity.RoomInventory;
import com.baomidou.mybatisplus.extension.service.IService;
import com.chixing.utils.Result;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author smith
 * @since 2025-09-30
 */
public interface IRoomInventoryService {
    //查询房间库存的时候顺便将商品的库存留一份在redis中
    public Result getRoomCount(Long hotelId, Date checkIn,Date checkOut);
    //下订单扣减库存
    public Result decrCount(Long hotelId, Date checkIn,Date checkOut,Long roomTypeId);
    //支付成功后locked_count-1,booked_count+1
    public Result decrLockCountAddBookedCount(Long hotelId, LocalDate checkIn, LocalDate checkOut, Long roomTypeId);

    void generateInventory();
    //将每月归档上月的库存
     void archiveInventoryMonthly();
    //做延迟退房的查询房型剩余数量
    Result getRoomTypeRoomCount(Long hotelId, Long roomTypeId, LocalDate checkOut);

    public void releaseBookedInventory(Long orderId);
}
